import { TypeOf, object, string } from "zod";

export const postSchema = object({
  body: object({
    title: string({
      required_error: "Title is required",
    }),
    content: string({
      required_error: "Content is required",
    }),
    boardId: string({
      required_error: "BoardId is required",
    }).uuid("Invalid BoardId"),
  }),
});
export const updatePostSchema = object({
  body: object({
    title: string(),
    content: string(),
  }).partial(),
});

export type PostSchema = TypeOf<typeof postSchema>["body"];
export type UpdatePostSchema = TypeOf<typeof updatePostSchema>["body"];
